<script setup>

import TinyMceEditor from "../../components/editor/TinyMceEditor.vue";
import {ref} from "vue";

const editorRef = ref(null);
const content = ref(null);
const setContent = () => {
  content.value = '<p>He<span style="background-color: #e03e2d;">llo </span>W<strong>orld!</strong></p>';
};
const getContent = () => {
  console.log(content.value);
  console.log(editorRef.value.getContent());
};
</script>

<template>
  <div>
    <el-button @click="setContent" type="primary">设置内容</el-button>
    <el-button @click="getContent" type="primary">获取内容内容</el-button>
    <TinyMceEditor ref="editorRef" v-model="content"/>
    <div v-html="content"></div>
  </div>
</template>

<style scoped>

</style>